package com.sizu.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sizu.entity.TSupplierStatement;
import com.sizu.mapper.TSupplierStatementMapper;
import com.sizu.service.ITSupplierStatementService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 赵玉玺
 * @since 2020-03-16
 */
@Service
public class TSupplierStatementServiceImpl extends ServiceImpl<TSupplierStatementMapper, TSupplierStatement> implements ITSupplierStatementService {

    @Override
    public boolean upTSupplierStatementState(String number) {
        Wrapper<TSupplierStatement> tSupplierStatementWrapper=new EntityWrapper<>();
        tSupplierStatementWrapper.eq("supplier_number",number);
        TSupplierStatement tSupplierStatement=new TSupplierStatement();
        tSupplierStatement.setState(2);
        this.baseMapper.update(tSupplierStatement,tSupplierStatementWrapper);
        return true;
    }

    @Override
    public List<TSupplierStatement> getTSupplierStatement() {
        Wrapper<TSupplierStatement> tSupplierStatementWrapper=new EntityWrapper<>();
        tSupplierStatementWrapper.eq("state","1");
        List<TSupplierStatement> tSupplierStatements = this.baseMapper.selectList(tSupplierStatementWrapper);
        return tSupplierStatements;
    }
}
